Introduce TOML-based configuration to replace data.py - #491
Draft
glehmann wants to merge 14 commits into
Draft
Conversation
This was referenced Apr 21, 2026
| "type": "object", | ||
| "properties": { | ||
| "path": { "type": "string" }, | ||
| "net-url": { "type": "string" }, |
Contributor
There was a problem hiding this comment.
Maybe you should choose a convention "snake_case" or "kebab-case", what do you think?
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
from
May 11, 2026 15:48
ee666c4 to
ed2606e
Compare
glehmann
force-pushed
the
gln/passlib-integration-kuyq
branch
from
May 11, 2026 15:48
789db8a to
ff81a81
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
from
May 12, 2026 13:16
ed2606e to
8c9e4e8
Compare
glehmann
force-pushed
the
gln/passlib-integration-kuyq
branch
from
May 12, 2026 17:08
ff81a81 to
4b18836
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
from
May 12, 2026 17:08
8c9e4e8 to
1271dc5
Compare
glehmann
force-pushed
the
gln/passlib-integration-kuyq
branch
from
May 13, 2026 13:58
4b18836 to
78b593a
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
2 times, most recently
from
May 13, 2026 14:20
5edbb05 to
7884b4e
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
2 times, most recently
from
May 19, 2026 15:29
b6a447b to
64dafbe
Compare
glehmann
force-pushed
the
gln/passlib-integration-kuyq
branch
from
May 19, 2026 15:37
6aa0263 to
f378395
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
2 times, most recently
from
May 20, 2026 19:02
01ba89d to
295d469
Compare
glehmann
force-pushed
the
gln/passlib-integration-kuyq
branch
2 times, most recently
from
May 22, 2026 15:29
123e95d to
f1dc1d7
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
2 times, most recently
from
May 22, 2026 16:59
837291c to
f3cdfc7
Compare
glehmann
force-pushed
the
gln/passlib-integration-kuyq
branch
from
May 22, 2026 16:59
f1dc1d7 to
406cf12
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
from
May 29, 2026 11:37
f3cdfc7 to
912c91c
Compare
glehmann
force-pushed
the
gln/passlib-integration-kuyq
branch
from
May 29, 2026 11:37
406cf12 to
435faac
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
2 times, most recently
from
June 10, 2026 08:57
3430eec to
9073a88
Compare
glehmann
force-pushed
the
gln/passlib-integration-kuyq
branch
from
June 10, 2026 08:57
903b4d8 to
4004073
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
from
August 18, 2026 10:08
9073a88 to
ef7ae50
Compare
ydirson
self-requested a review
August 19, 2026 08:16
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
3 times, most recently
from
August 20, 2026 21:55
026f4b5 to
2f66aee
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
from
August 25, 2026 20:01
2f66aee to
cc37fcb
Compare
glehmann
force-pushed
the
gln/typehints-next
branch
2 times, most recently
from
August 25, 2026 20:59
564f75e to
d7096af
Compare
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
from
August 25, 2026 20:59
b903273 to
5d73dfd
Compare
The previous data.py approach had several shortcomings: - No base configuration: users had to start from scratch or copy data.py-dist - No environment management: working with multiple infra required to manually copy the data.py files - No clear default and customization separation: the data.py, once copied from data.py-dist and customized, was mixing the defaults and the customizations The new TOML config system addresses this by: - Providing a base config.toml maintained by the project with sensible defaults, which can be updated without user action - Supporting per-environment override files (config.<name>.toml) so users only specify what differs from the defaults, making their customizations explicit Options have been grouped by sections for clarity. Configuration sections and their contents: - [host]: default XAPI credentials (user, password) - [hosts]: per-host credential overrides - [network]: management network name - [pxe]: PXE server settings (arp_server) - [vm]: VM settings (default_sr, images, equivalents, def_url) - [install]: installer settings (answerfiles, iso_remaster, isos) - [guest_tools]: guest tools packages and installer ISOs (win, other, installed, download_url) - [ssh]: SSH client settings (pubkey, output_max_lines, ignore_banner) - [storage]: storage backend configs (nfs, nfs4, nfs_iso, cifs_iso, cephfs, moosefs, lvmoiscsi) - Root keys: objects_name_prefix, dns_server Also includes lib/config_loader.py (Pydantic models) to validate the configuration. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
To make easier editing within our editors. This format is compatible with multiple toml lsp, including taplo. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Configuration is now done in config.toml and config.*.toml Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Config files can now reference other TOML files via a root-level
`include` array. Included files are deep-merged before the
including file's own content, with paths resolved relative to
the including file's directory. Cycle detection prevents infinite
recursion. Both `config.toml` and `config.{name}.toml` override
files support this mechanism.
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Configuration values can now be overridden at runtime with `XCPNG_TESTS_`-prefixed environment variables. Double underscores separate path segments (e.g. `XCPNG_TESTS_network__free_nics='["eth1"]'` overrides `config.network.free_nics`). Values are parsed as TOML when possible, falling back to plain strings - so booleans, integers, arrays, and inline tables work naturally alongside plain string values. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
The config file now holds the inventory: [default] provides default repositories/hosting_pool settings applied to all hosts, [hosts] lists the pool masters to run against, and both pytest and tools.py read from it. --config/-c accepts a profile name or a .toml file path anywhere on disk; config.local.toml is auto-merged when no override is given, and include paths resolve relative to the including file first, then the repo root. - tools.py: -i/--inventory removed; -H still overrides, -e/-x/-P act as temporary overrides; clean/exec fall back to config hosts too - conftest: hosts fixture uses config [hosts] when --hosts is empty - host_data(): fall back to default user/password for bare [hosts] entries - schema: overlays validate without required keys while typos stay flagged (additionalProperties: false); new [default] section - update task: guard against an empty pool list - config.toml, README: document the new layout Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
-c NAME / XCPNG_CONFIG=NAME now looks up config.NAME.toml in the directory given by the XCPNG_CONFIG_DIR env var when it is set, then in the xcp-ng-tests repository root. A value that matches a file is otherwise used as a path relative to the current directory; the repository root and current directory are no longer searched for profile names. Documented in the README's configuration section. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Allow selecting a config overlay via the XCPNG_CONFIG environment variable, equivalent to the --config flag. Update docs and CLI help accordingly. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
…against the base `tools.py dump-config` prints the final configuration (base config.toml + layered includes + overrides) as TOML, or JSON with --json; the TOML output is deterministically ordered and syntax-colored on TTYs (--color/--no-color to force). dump-config and migrate-data-py now print only values that differ from the base config.toml, with --all restoring the full config. The shared helpers (remove_defaults, deep_dict_equal, _strip_password_hashes) live in lib/config_dump, and load_config gains apply_value_overrides=False to compute the base config without XCPNG_TESTS_* / --config-value overlays. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
--config-value KEY=VALUE overrides a single config value at runtime, with the KEY being a dotted path (double quotes around segments that contain dots). Values are parsed as TOML, so booleans, numbers, arrays and inline tables work too. Precedence is config.toml < overlay < XCPNG_TESTS_* env vars < --config-value. Wired into pytest (--config-value) and tools.py; the override is applied before the password hash is computed, so default_password and default_password_hash stay consistent. Documented in the README's configuration section. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
diff-config CONFIG1 CONFIG2 prints a unified diff between two resolved configs, ignoring password hashes; TOML by default, --json for JSON representation. Exits 0 when the configs are identical, 1 otherwise. Configs are loaded without value/env overrides so both sides are compared on their own contents. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Make jobs.py use the same configuration as pytest and tools.py: -c/--config, XCPNG_CONFIG/XCPNG_CONFIG_DIR and --config-value are now accepted, and jobs.py run falls back to the hosts defined in the config's [hosts] section when no hosts are given explicitly. Documented in the README. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
A config written for a newer version of the project may contain keys this version does not support. Load it anyway, dropping the unknown keys with a warning instead of aborting, so the same config can be shared across project versions. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
glehmann
force-pushed
the
gln/config-migration-to-toml-mxrr
branch
from
August 30, 2026 20:15
5d73dfd to
eef21f1
Compare
glehmann
force-pushed
the
gln/typehints-next
branch
from
August 30, 2026 20:15
d7096af to
2e63777
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous data.py approach had several shortcomings:
copy the data.py files
from data.py-dist and customized, was mixing the defaults and the
customizations
The new TOML config system addresses this by:
which can be updated without user action
specify what differs from the defaults, making their customizations explicit
Options have been grouped by sections for clarity.
Configuration sections and their contents:
Also includes config-schema.json, lib/config_loader.py (Pydantic models),
and scripts/migrate_data_py.py to help users migrate from data.py.